package com.kiss.rpc.proxy;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class RpcProxyFactory {
    // 本地缓存，键为类，值为其的代理对象
    private final static Map<Class<?>, Object> cache = new ConcurrentHashMap<>(32);

    public static <T> T getProxy(Class<T> clazz) {
        Object obj = cache.get(clazz);
        if (obj != null) {
            return (T) obj;
        }
        return null;
    }
}
